﻿<UserControl x:Class="MachineQA.View.MachinesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MachineQA.ViewModel"
             xmlns:views="clr-namespace:MachineQA.View"
             mc:Ignorable="d" 
             d:DesignHeight="1200" d:DesignWidth="1240">
    <UserControl.Resources>
    </UserControl.Resources>
    <StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1240" Height="1200">
        <ItemsControl Name="SelectedMachines"
        ItemsSource="{Binding Path=SelectedMachine}">
        </ItemsControl>

        <Button Content="Button" Height="23" Name="button1" Width="75" Click="button1_Click" />
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
            <GroupBox Header="Machines" Width="300" Height="530">
                <StackPanel Orientation="Vertical">
                    <ListBox Name="MachinesList"
                             Height="300" 
                             Width="290" 
                             DataContext="{Binding Path=AllMachines}"
                             SelectionMode="Single"
                             ItemsSource="{Binding}" SelectionChanged="MachinesList_SelectionChanged"
                             HorizontalAlignment="Right"
                             >
                    </ListBox>
                    <Label Name="NewLabel" Content="New item details:"/>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Orientation="Vertical">
                            <Label Name="MachineNameLabel" Content="Machine name: " HorizontalAlignment="Right" Height="25"/>
                            <Label Name="LocationLabel" Content="Location: " HorizontalAlignment="Right" Height="25"/>
                        </StackPanel>
                        <StackPanel Orientation="Vertical">
                            <TextBox Name="NewMachineNameBox" Width="200" TextChanged="NewMachineNameBox_TextChanged" DataContext="{Binding Path=NewMachine}" Text="{Binding Path=Name,Mode=TwoWay}" HorizontalAlignment="Center"/>
                            <ComboBox x:Name="LocationCombobox" Width="200" ItemsSource="{Binding Path=AvailableLocations}" HorizontalAlignment="Center" DisplayMemberPath="Name" SelectionChanged="LocationCombobox_SelectionChanged" />
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                    </StackPanel>
                    <StackPanel Orientation="Horizontal"></StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button Name="MachineDeleteButton" Content="Delete" Command="{Binding Path=DeleteCommand}" Width="50" Margin="0,0,5,0" Click="MachineDeleteButton_Click" />
                        <Button Name="MachineSaveButton" Content="Create Machine" IsEnabled="false" Command="{Binding Path=SaveCommand}" Height="40"  Width="100" HorizontalAlignment="Right" HorizontalContentAlignment="Center" />
                    </StackPanel>
                </StackPanel>
            </GroupBox>
        </StackPanel>
    </StackPanel>
</UserControl>
